<?php

class SmsController extends Controller
{



    /*
     * 获取短信列表
     *
     */
    public function actionGetSmsList()
    {
        try
        {


            //检测
            $user_id = SessionService::getUserIDBySessionid();

            //初始化
            $searchsql = Util::initSearchSql();

            $searchsql = Util::getSerarchStr($searchsql,"mobile","mobile"); //手机号
            $searchsql = Util::getSerarchStr($searchsql,"type","type"); //种类

            //获取count
            $totalcount = GlSms::model()->count($searchsql);



            //排序
            $searchsql = $searchsql." order by sms_id desc";
            //加上分页控制
            $searchsql = Util::addLimitSql($searchsql);

            //Util::responseMsg($searchsql);

           //获取list
            $smslist = GlSms::model()->findAll($searchsql);



           // Util::responseObj(MsgConst::RETURN_SUCCESS);
            Util::responseList($totalcount,$smslist);


        }catch (Exception $e)
        {

            Util::responseErrorMsg($e->getMessage());

        }
    }
}